:: This batch file will connect to the server using telnet.
:: It will restart whenever the connection is lost.

@echo off
cls
telnet localhost 25
echo To reconnect:
pause
run-telnet-client